#!/bin/bash

PROJECT_HOME=/root/workspace/flight-ultimate

cd $PROJECT_HOME

git reset --hard
git pull origin dev
docker login --username=15527462726 registry.cn-shanghai.aliyuncs.com -p CNAlbert2021240158

mvn -Dmaven.test.skip=true clean install package

while read rows
do
  cp ${rows}/target/*.jar ./auto_deploy/scripts/jar/
done < ./auto_deploy/JAR_PATHS.fu

chmod +x ./auto_deploy/scripts/start.sh
chmod +x ./auto_deploy/scripts/build.sh
chmod +x ./auto_deploy/scripts/push.sh
chmod +x ./auto_deploy/scripts/k8s/start.sh
chmod +x ./auto_deploy/scripts/k8s/variable_injection.sh

cd ./auto_deploy

source version

echo "工作目录 `pwd`"
echo "版本号 ${V_SERVER}"

cd ./scripts

./start.sh